var rId = null;
var rid = null;


$(function(){
	$.ajax({
		type:"GET",
		url:"findallrole.do",
		dataType:"json",
		success:function(data){
			var op = "<option>--请选择--</option>";
			var rid = $("#rid").val();
			for(var i=0;i<data.key.length;i++){
				if(rid!=null && rid!=undefined && data.key[i].rId==rid){
					op += "<option value=\""+data.key[i].rId+"\" selected=\"selected\">"+data.key[i].rName+"</option>";
				}else{
					op += "<option value=\""+data.key[i].rId+"\">"+data.key[i].rName+"</option>";	
				}
			}
			$("#rId").html(op);
		}
		
	});
});